// 设置本地存储
export const setStorage = (key, value) => {
  try {
    uni.setStorageSync(key, value)
    return true
  } catch (e) {
    console.error('存储失败：', e)
    return false
  }
}

// 获取本地存储
export const getStorage = (key) => {
  try {
    return uni.getStorageSync(key)
  } catch (e) {
    console.error('获取存储失败：', e)
    return null
  }
}

// 移除本地存储
export const removeStorage = (key) => {
  try {
    uni.removeStorageSync(key)
    return true
  } catch (e) {
    console.error('移除存储失败：', e)
    return false
  }
}

// 清空本地存储
export const clearStorage = () => {
  try {
    uni.clearStorageSync()
    return true
  } catch (e) {
    console.error('清空存储失败：', e)
    return false
  }
} 